<template>
  <div class="table-page-search-wrapper">
    <el-form :model="searchForm" ref="searchForm" label-width="100px" class="demo-ruleForm">
      <el-row :gutter="10">
        
        <el-col :md="6" :sm="12" :xs="24">
          <el-form-item label="选择日期:">
            <a-range-picker
              @change="cxsjChange"
              style="width:100%"
              v-model="time"
              
              show-time
              format="YYYY-MM-DD HH:mm:ss"
            >
              <a-icon slot="suffixIcon" type="smile" />
            </a-range-picker>
          </el-form-item>
        </el-col>
        <!-- <el-col :md="6" :sm="12" :xs="24">
          <el-form-item label="门店名称:">
            <a-input v-model="searchForm.shopName" placeholder="请输入门店名称" />
          </el-form-item>
        </el-col> -->
        <el-col :md="6" :sm="12" :xs="24">
          <div style="margin-left:30px">
            <a-button type="primary" icon="search" @click="searchAction()">查询</a-button>
            <a-button icon="delete" @click="resetSearch()" style="margin-left: 8px;">重置</a-button>
          </div>
        </el-col>
      </el-row>
    </el-form>
  </div>
</template>
<script>
import moment from 'moment'
export default {
  name: 'search',
  data() {
    return {
      searchForm: {},
      time: [],
    }
  },
  methods: {
    moment,
    searchAction() {
      //执行搜索
      this.$emit('search')
    },
    resetSearch() {
      this.searchForm = {}
      this.time = []
      this.$emit('resetSearch')
    },
    getSearchForm() {
      //获取高级搜索条件
      return {
        ...this.searchForm,
      }
    },
    cxsjChange(e) {
      if(e.length == 0) return false
      this.searchForm.beginTime = this.formDate(e[0]._d)
      this.searchForm.endTime = this.formDate(e[1]._d)
    },
  },
}
</script>


<style lang="less">
</style>>
